#include <stdio.h>
#include <stdlib.h>

#define length 20

struct 链表
{
    int context;
    struct 链表 *next;
};

typedef struct 链表 lists;

lists *Create_List()
{
    /**
     * 必须先分配内存，再进行其他操作
     */
    lists *head = (lists *)malloc(sizeof(lists));
    lists *template = head;
    // head = template;
    // head->next = NULL;
    printf("head is %p node is %p\n", head, template);
    for (int i = 0; i <= length; i++)
    {
        lists *node = (lists *)malloc(sizeof(lists));
        printf("%d\n",i);
        node->context = i;
        // template = node;// ~~这句和`template->next = node;`是等价的~~
        template->next = node;
        node = node->next;
    }
    return head;
}

int main(void)
{
    lists *arr = Create_List();
    printf("sth is %d\n", arr->next);
    return 0;
}